#include <string.h>
#include <iostream>
int main(int argc, char const *argv[])
{
  if (argc == 2 )
  {
    if (strcmp(argv[1], "on") == 0)
    {

      system("sudo nmcli connection modify CMCC ipv4.addresses 192.168.2.55/24");
      system("sudo nmcli connection modify CMCC ipv4.gateway 192.168.2.112");
      system("sudo nmcli connection modify CMCC ipv4.dns \"192.168.2.112\"");
      system("sudo nmcli connection modify CMCC ipv4.method manual");
      system("sudo nmcli connection up CMCC");
      
    }else if (strcmp(argv[1], "off") == 0)
    {
      system(" nmcli connection delete CMCC");
      system(" nmcli d wifi connect CMCC password 994759771qaz");
    }
    
    else
    {
      printf("请使用tproxy on或者off");
    }
    
  }
  else
  {
    printf("请使用tproxy on或者off");
  }
  return 0;
}
